//路由鉴权
import React, { useEffect, useState } from 'react';
import { Navigate, useLocation } from 'react-router-dom';

interface PrivateRouteProps {
  Childer: React.ComponentType<any>;
}

const PrivateRoute: React.FC<PrivateRouteProps> = ({ Childer }) => {
  const token = localStorage.getItem('accessToken');
  return token ? <Childer /> : <Navigate to="/login" />;
};

export default PrivateRoute;
